package com.example.superoa.model.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.example.superoa.model.dao.StaffDao;
import com.example.superoa.model.mappers.DemoMapper;
import com.example.superoa.model.pojos.Staff;
import com.example.superoa.model.vo.DeptVo;

@Service
@Transactional(rollbackFor=Exception.class)
public class DemoService {
	@Autowired
	private DemoMapper map;
	@Autowired
	private StaffDao s_dao;
	
	public JSONArray selectKuang() {
		return map.selectAll();
	}
	
	public List<DeptVo> selectShu() {
		return map.selectShu();
	}
	public Staff selectStaffid(int id) {
		return s_dao.findById(id).get();
	}
	public JSONObject selectID(int staff_id) {
		return map.selectID(staff_id);
	}
	public JSONArray selectJi() {
		return map.selectRp();
	}
	public JSONArray selectposition() {
		return map.selectposition();
	}
	public JSONArray selectShijuan() {
		return map.selectShijuan();
	}
}
